package model;

public class CMYKColor {

	private double cyan = 0;
	private double magenta = 0;
	private double yellow = 0;
	private double black = 0;
	
	public CMYKColor(double cyan, double magenta, double yellow, double black) {
		this.cyan = cyan;
		this.magenta = magenta;
		this.yellow = yellow;
		this.black = black;
		
	}
	
	//http://www.rapidtables.com/convert/color/cmyk-to-rgb.htm
	public RGBColor convertCMYKToRGB(double cyan, double magenta, double yellow, double black) {
		
		//System.out.println("Methode convertCMYKToRGB IN C:" + cyan + " M:" + magenta + " Y:" + yellow + " K:" + black);
		RGBColor colorToReturn = new RGBColor(0,0,0);
		colorToReturn.setRed((int) (255 * (1-cyan) * (1-black)));
		colorToReturn.setGreen((int) (255 * (1-magenta) * (1-black)));
		colorToReturn.setBlue((int) (255 * (1-yellow) * (1-black)));
		
		//System.out.println("Methode convertCMYKToRGB OUT R:" + red + " G:" + green + " B:" + blue);
		
		return colorToReturn;
	}
	
	public double getCyan() {
		return cyan;
	}

	public void setCyan(double cyan) {
		this.cyan = cyan;
	}

	public double getMagenta() {
		return magenta;
	}

	public void setMagenta(double magenta) {
		this.magenta = magenta;
	}

	public double getYellow() {
		return yellow;
	}

	public void setYellow(double yellow) {
		this.yellow = yellow;
	}

	public double getBlack() {
		return black;
	}

	public void setBlack(double black) {
		this.black = black;
	}
}
